<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ include file="/WEB-INF/jsp/sys/css.jsp"%>
<%@ include file="/WEB-INF/jsp/sys/uploader.jsp" %>
<%@page import="com.centit.util.RequestUtil" %>

<html lang="zh-cmn-Hans">
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/modules/util/static/ztree/css/metroStyle/metroStyle.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/modules/util/static/plugin/css/index.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/modules/util/static/ztree/js/jquery.ztree.all.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/modules/util/static/plugin/js/selectTree.js"></script>
<script type="text/javascript"	src="${pageContext.request.contextPath}/modules/airplanebaseinfo/airplanebaseinfo/ctrl/airplanebaseinfo.edit.js"></script>
<style>
    .stream-main-upload-box {
        border: none;
    }

    .centit-uploader .uploaded-files li {
        padding: 10px 20px 10px 10px;
    }

</style>
</head>
<body style="height: 100%;">
	<form class="layui-form" id="airplanForm" action="" style="padding: 10px"
		lay-filter="azdbqryForm">
		<input type="hidden" name="recId" id="recId" value="${object.recId}">
		<input type="hidden" name="nextUser" id="nextUser" value="">
		<input type="hidden" name="status" id="status" value="">
		<table class="viewTable">
			<tr>
				<th class="required">关联计划</th>
				<td colspan="3">
					<select id="gljh" name="gljh" lay-verify="required" lay-search="">
						<option value="">--直接选择或搜索选择--</option>
					</select>
					<input type="hidden" id="gljhid" value="${object.gljh}"/>
				</td>
			</tr>
			<tr>
				<th class="required">航空器型号和制造人</th>
				<td>
					<input type="text" name="airModel" id="airModel" class="layui-input" lay-verify="required" value="${object.airModel}">
				</td>
				<th class="required">国籍登记证编号</th>
				<td>
					<input type="text" name="gjNo" id="gjNo" class="layui-input" lay-verify="required" value="${object.gjNo}">
				</td>
			</tr>
			<tr>
				<th class="required">航空器出厂序号</th>
				<td>
					<input type="number" name="ccxlh" id="ccxlh" class="layui-input" lay-verify="required" value="${object.ccxlh}">
				</td>
				<th class="required">登记时间</th>
				<td>
					<input type="text" name="djsj" id="djsj" class="layui-input" lay-verify="required" value="${object.djsj}" readonly="readonly">
				</td>
			</tr>
			
			<tr>
				<th class="required">出厂日期</th>
				<td>
					<input type="text" name="proctionDate" id="proctionDate" class="layui-input" lay-verify="required" value="<fmt:formatDate value='${object.proctionDate}' pattern='yyyy-MM-dd'/>" >
				</td>
				<th class="required">飞机性质</th>
				<td>
					<select name="nature" class="layui-input" lay-filter="nature" id="nature" lay-verify="required"  value="${object.nature}">
								<option value="">--请选择--</option>
								<c:forEach items="${cp:DICTIONARY('AIRXZ')}" var="row">
				         			<option value="${row.dataCode }" <c:if test="${object.nature eq row.dataCode }">selected="selected"</c:if> >${row.dataValue }</option>
				   				</c:forEach>
					</select>
				</td>
			</tr>
			<tr>
				<th>本证发给</th>
				<td style="height:100px;" colspan="3">
					<div class="layui-input-block" style="margin-left: 0;">
						<textarea name="bzfj" placeholder="请输入内容" class="layui-textarea">${object.bzfj}</textarea>
					</div>
				</td>
				<%-- <th class="required">租赁起始日期</th>
				<td>
					<input type="text" name="startTime" id="startTime" class="layui-input" lay-verify="required" value="${object.startTime}">
				</td>
				<th class="required">租赁到期日期</th>
				<td>
					<input type="text" name="endTime" id="endTime" class="layui-input" lay-verify="required" value="${object.endTime}">
				</td> --%>
			</tr>
			<tr>
				<th>批文</th>
	                    <td colspan="3">
	                        <div class="layui-input-inline tdcontent" >
	                        <input type="hidden"  id="pw" name="pw"  value="${object.pw}" />
	                        </div>
	                    </td>
				
			</tr>
			<tr>
			<th>飞机合同</th>
	                    <td colspan="3">
	                        <div class="layui-input-inline tdcontent" >
	                        <input type="hidden"  id="ht" name="ht"  value="${object.ht}" />
	                        </div>
	                    </td>
			</tr>
		</table>
		<div style="text-align: center; margin-top: 20px">
			<button class="layui-btn" lay-submit="" lay-filter="formSubmit" id="send">发送</button>
			<button class="layui-btn" lay-submit="" lay-filter="saveSubmit">保存</button>
			<button class="layui-btn layui-btn-primary" onclick="CloseWin()">关闭</button>
		</div>
	</form>
	<script>
var basePath= "${pageContext.request.contextPath}";
</script>

 <script type="text/javascript">
 window.UploaderPath='${cp:SYS_VALUE("uploaderpath")}/';
	index = setInterval(setUpload, '1000');
	function setUpload() {
	    try {
	    	  if (typeof $('#pw', null).uploader === "function") { 
	              clearInterval(index);
	              $('#pw', null).uploader({
	                  UploaderPath: window.UploaderPath,           
	                  ViewContextPath: window.UploaderPath,
	                  info: {
	                      optId: 'applyAdd'    
	                  }
	              });
	          } else {
	        	  
	          }
	      } catch (e) {
	      }
	      try {
	    	  if (typeof $('#ht', null).uploader === "function") { 
	              clearInterval(index);
	              $('#ht', null).uploader({
	                  UploaderPath: window.UploaderPath,           
	                  ViewContextPath: window.UploaderPath,
	                  info: {
	                      optId: 'applyAdd'    
	                  }
	              });
	          } else {
	        	  
	          }
	      } catch (e) {
	      }
	  }
	
    function additem(id, name, valueName, valueCode) {
        $('input[id^=' + valueCode + ']').val(id);
        $('input[id^=' + valueName + ']').val(name);
        
        var recId=$("#recId").val();
		$("#status").val("1");
		if(recId==null||typeof(recId)=='undefined'||recId==''){
			recId='0';
		}
		$.ajax({
	        type: "PUT",
	        url: basePath+'/service/airplanebaseinfo/airplanebaseinfo/'+recId,
	        data: $("#airplanForm").serialize(),
	        async:false,
	        dataType: "json",
	        success: function(data){
	        	if(data.code=='0'){
	        		layer.msg("操作成功", {icon: 1});
	        		 parent.location.reload();	
	    		} else {
	    			layer.msg("操作失败", {icon: 0});
	    		}
	        }
	    });
    };
 </script>
</body>
</html>
